<style>
    .layui-btn:not(.layui-btn-lg ):not(.layui-btn-sm):not(.layui-btn-xs) {height:34px;line-height:34px;padding:0 8px;}
</style>
<body>
<div class="layuimini-container layuimini-page-anim">
    <div class="layuimini-main">
        <div >
            <table id="table" class="layui-table" lay-filter="table"></table>
        </div>
    </div>
</div>

<!-- 操作列 -->
<script type="text/html" id="auth-state">
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="show">详情</a>
</script>
<script>
    layui.use(['table','miniIndex'], function () {
        var $ = layui.jquery;
        var table = layui.table;
        var miniIndex = layui.miniIndex;

        // 渲染表格
        layer.load(2);
        var table_list = table.render({
            elem: '#table',
            url: '/admin/message/list',
            title: '网站留言',
            page: true,
            limit: 10,
            cols: [[
                {type: 'numbers'},
                {field: 'name', title: '留言姓名'},
                {field: 'email', title: '邮箱'},
                {field: 'phone', title: '电话'},
                {field: 'ip', title: 'IP'},
                {field: 'created_at', title: '添加时间'},
                {field: 'updated_at', title: '更新时间'},
                {templet: '#auth-state', width: 120, align: 'center', title: '操作'}
            ]],
            done: function () {
                layer.closeAll('loading');
            }
        });
        // 表格操作事件
        miniIndex.tableEvent('message');

    });
</script>
</body>
